package xxl.robotlegs.base.log 
{
	import flash.utils.getTimer;
	import xxl.robotlegs.core.ILogger;
	import xxl.robotlegs.core.ILogTarget;
	
	/**
	 * ...
	 * @author XXL
	 */
	public class Logger implements ILogger 
	{
		private var _source:Object;
		private var _target:ILogTarget;
		
		public function Logger(source:Object, target:ILogTarget) 
		{
			_source = source;
			_target = target;
		}
		
		/* INTERFACE xxl.robotlegs.core.ILogger */
		
		public function debug(message:*, params:Array = null):void 
		{
			_target.log(_source, LogLevel.DEBUG, getTimer(), message, params);
		}
		
		public function info(message:*, params:Array = null):void 
		{
			_target.log(_source, LogLevel.INFO, getTimer(), message, params);
		}
		
		public function warn(message:*, params:Array = null):void 
		{
			_target.log(_source, LogLevel.WARN, getTimer(), message, params);
		}
		
		public function error(message:*, params:Array = null):void 
		{
			_target.log(_source, LogLevel.ERROR, getTimer(), message, params);
		}
		
		public function fatal(message:*, params:Array = null):void 
		{
			_target.log(_source, LogLevel.FATAL, getTimer(), message, params);
		}
		
	}

}